# write by hasaki
# first edit on 2018/01/04
# last change on 2018/01/04
# 伪造的bitmexrset接口
import os
import sys
sys.path.append(os.getcwd())
import json
from flask import Flask,request,make_response
app=Flask(__name__)
app.secret_key='hashaki'
i=0
@app.route('/')
def hasaki():
    '''测试flasK的展示'''
    return "你能看见吗？,真的吗"

@app.route('/prepare',methods=['POST','GET','PUT','DELETE','QUERY'])
def order():
    '''接收交易引擎的order数据'''
    res=make_response()
    res.status_code=200
    res.headers['content-type']="hasaki"
    data={'hasaki':'fuck the world'}
    data_=json.dumps(data)
    res.response=data_
    if request.method=='POST':
        print('获取到post请求')
        print('请求头',request.headers)
        print('請求内容',request.data)
        return res
    else:
        return "不是post方法"

if __name__=='__main__':
    app.run(host='127.0.0.1',port=7778,debug=True)